package com.tanhua.autoconfig;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.tanhua.autoconfig.properties.*;
import com.tanhua.autoconfig.templates.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;


@EnableConfigurationProperties(
        value = {
                SmsProperties.class,
                OssProperties.class,
                AipFaceProperties.class,
                HuanXinProperties.class,
                GreenProperties.class
        }
)
public class TanhuaAutoConfiguration {
    @Bean
    public SmsTemplate smsTemplate() {
        return new SmsTemplate();
    }

    @Bean
    public OssTemplate ossTemplate() {
        return new OssTemplate();
    }

    @Bean
    public AipFaceTemplate aipFaceTemplate() {
        return new AipFaceTemplate();
    }

    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties properties) {
        return new HuanXinTemplate(properties);
    }
    @Bean
    public AliyunGreenTemplate aliyunGreenTemplate(GreenProperties properties) {
        return new AliyunGreenTemplate(properties);
    }

}
